package com.cc2019.buke.user.Activity;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.cc2019.buke.MainActivity;
import com.cc2019.buke.R;
import com.cc2019.buke.user.frag.UserFragment;

public class SettingActivity extends AppCompatActivity implements View.OnClickListener{
    private Button button;
    private Button about_ours;
    private Button my_users;
    private Button backtoU;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_setting);
        button=(Button)findViewById(R.id.login_out);
        button.setOnClickListener((view)->{
            setResult(10);
            finish();
        });
        about_ours=(Button)findViewById(R.id.about_ours);
        about_ours.setOnClickListener(this);
        my_users=(Button)findViewById(R.id.my_user);
        my_users.setOnClickListener(this);

        backtoU=(Button) findViewById(R.id.back_to_userfragment);

        backtoU.setOnClickListener(this);


    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.about_ours:
                Intent intent=new Intent(this,AboutActivity.class);
                startActivity(intent);
                break;
            case R.id.my_user:
                Intent intent1=new Intent(this,MyInfoActivity.class);
                //传页面！！
                intent1.putExtra("username",getIntent().getStringExtra("username"));
                startActivity(intent1);
                break;
            case R.id.back_to_userfragment:
                Intent intent3=new Intent(this,MainActivity.class);
                startActivity(intent3);
                break;
        }

        }
    }
